kexec: clear kexec_image slot when unloading kexec image
authorBhavesh Davda <bhavesh.davda@oracle.com>
Tue, 4 Apr 2017 09:34:57 +0000 (11:34 +0200)
committerJan Beulich <jbeulich@suse.com>
Tue, 4 Apr 2017 09:34:57 +0000 (11:34 +0200)
commit5c5216e825332c83b1965b5a39a6100f9dde34da
treec3ff92cce5ab5da476280357c667ea7e37723d5d
parentbc32c6e3f34f46aada3a9ee80fff171e1ce75d69
kexec: clear kexec_image slot when unloading kexec image

When kexec_do_unload calls kexec_swap_images to get the old kexec_image to
free, it passes NULL for the new kexec_image pointer. The new slot wasn't being
cleared in such a case, leading to a stale pointer being left behind in the
kexec_image array and Xen panics in subsequent load/unload operations.

Signed-off-by: Bhavesh Davda <bhavesh.davda@oracle.com>
Reviewed-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
Reviewed-by: Jan Beulich <jbeulich@suse.com>
Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
xen/common/kexec.c